 package server.commands;

 import client.MapleCharacter;
 import client.MapleCharacterUtil;
 import client.MapleClient;
 import client.MapleStat;
 import client.anticheat.ReportType;
 import client.inventory.Item;
 import client.inventory.MapleInventoryType;
 import client.skills.Skill;
 import client.skills.SkillFactory;
 import handling.channel.ChannelServer;
 import handling.world.CheaterData;
 import handling.world.World;
 import handling.world.WorldBroadcastService;
 import handling.world.WorldFindService;
 import java.awt.Point;
 import java.io.Serializable;
 import java.text.DateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import scripting.event.EventInstanceManager;
 import scripting.event.EventManager;
 import server.MapleInventoryManipulator;
 import server.MapleItemInformationProvider;
 import server.MaplePortal;
 import server.life.MapleLifeFactory;
 import server.life.MapleMonster;
 import server.life.MapleNPC;
 import server.maps.MapleMap;
 import server.maps.MapleMapFactory;
 import server.maps.MapleMapObject;
 import server.maps.MapleMapObjectType;
 import server.maps.MapleReactor;
 import server.quest.MapleQuest;
 import server.squad.MapleSquad;
 import server.squad.MapleSquadType;
 import tools.MaplePacketCreator;
 import tools.Pair;
 import tools.StringUtil;
 import tools.packet.EffectPacket;





 public class InternCommand
 {
/*   57 */   private static final Logger log = LogManager.getLogger(InternCommand.class);




   public static PlayerGMRank getPlayerLevelRequired() {
/*   63 */     return PlayerGMRank.INTERN;
   }


   public static class hide
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*   71 */       Skill skill = SkillFactory.getSkill(9001004);
/*   72 */       Skill skill2 = SkillFactory.getSkill(1010);
/*   73 */       if (c.getPlayer().isHidden()) {
/*   74 */         c.getPlayer().cancelEffect(skill.getEffect(1), false, -1L);
/*   75 */         c.getPlayer().cancelEffect(skill2.getEffect(1), false, -1L);
/*   76 */         c.getPlayer().dropMessage(6, "隐身模式已关闭.");
       } else {
/*   78 */         skill.getEffect(1).applyTo(c.getPlayer());
/*   79 */         skill2.getEffect(1).applyTo(c.getPlayer());
/*   80 */         c.getPlayer().dropMessage(6, "隐身模式已开启.");
       }
/*   82 */       return 0;
     }
   }


   public static class LowHP
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*   91 */       c.getPlayer().updateSingleStat(MapleStat.HP, 1L);
/*   92 */       c.getPlayer().updateSingleStat(MapleStat.MP, 1L);
/*   93 */       c.getPlayer().getStat().setHp(1, c.getPlayer());
/*   94 */       c.getPlayer().getStat().setMp(1, c.getPlayer());
/*   95 */       return 0;
     }
   }


   public static class Heal
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  104 */       c.getPlayer().getStat().heal(c.getPlayer());
/*  105 */       c.getPlayer().dispelDebuffs();
/*  106 */       return 0;
     }
   }


   public static class HealHere
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  115 */       MapleCharacter player = c.getPlayer();
/*  116 */       for (MapleCharacter mch : player.getMap().getCharacters()) {
/*  117 */         if (mch != null) {
/*  118 */           mch.getStat().setHp(mch.getStat().getMaxHp(), mch);
/*  119 */           mch.updateSingleStat(MapleStat.HP, mch.getStat().getMaxHp());
/*  120 */           mch.getStat().setMp(mch.getStat().getMaxMp(), mch);
/*  121 */           mch.updateSingleStat(MapleStat.MP, mch.getStat().getMaxMp());
/*  122 */           mch.dispelDebuffs();
         }
       }
/*  125 */       return 1;
     }
   }


   public static class TempB
     extends TempBan {}

   public static class TempBan
     extends CommandExecute
   {
     public String getParameter() {
/*  137 */       return "<玩家名字> <理由> <多少天>";
     }

/*  140 */     private final String[] types = new String[] { "HACK", "BOT", "AD", "HARASS", "CURSE", "SCAM", "MISCONDUCT", "SELL", "ICASH", "TEMP", "GM", "IPROGRAM", "MEGAPHONE" };

     protected boolean ipBan = false;

     public int execute(MapleClient c, String[] splitted) {
/*  145 */       if (splitted.length < 4) {
/*  146 */         c.getPlayer().dropMessage(6, "用法: !Tempban " + getParameter());
/*  147 */         StringBuilder s = new StringBuilder("Tempban reasons: ");
/*  148 */         for (int i = 0; i < this.types.length; i++) {
/*  149 */           s.append(i + 1).append(" - ").append(this.types[i]).append(", ");
         }
/*  151 */         c.getPlayer().dropMessage(6, s.toString());
/*  152 */         return 0;
       }
/*  154 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  155 */       int reason = Integer.parseInt(splitted[2]);
/*  156 */       int numDay = Integer.parseInt(splitted[3]);

/*  158 */       Calendar cal = Calendar.getInstance();
/*  159 */       cal.add(5, numDay);
/*  160 */       DateFormat df = DateFormat.getInstance();

/*  162 */       if (victim == null || reason < 0 || reason >= this.types.length) {
/*  163 */         c.getPlayer().dropMessage(6, "Unable to find character or reason was not valid, type tempban to see reasons");
/*  164 */         return 0;
       }
/*  166 */       victim.tempban("Temp banned by " + c.getPlayer().getName() + " for " + this.types[reason] + " reason", cal, reason, this.ipBan);
/*  167 */       c.getPlayer().dropMessage(6, "The character " + splitted[1] + " has been successfully tempbanned till " + df.format(cal.getTime()));
/*  168 */       return 1;
     }
   }



   public static class B
     extends Ban {}


   public static class Ban
     extends CommandExecute
   {
     protected boolean hellban = false, ipBan = false;


     private String getCommand() {
/*  185 */       if (this.hellban) {
/*  186 */         return "HellBan";
       }
/*  188 */       return "Ban";
     }



     public String getParameter() {
/*  194 */       return "<角色名> <理由>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  199 */       if (splitted.length < 3) {
/*  200 */         c.getPlayer().dropMessage(5, "用法 !" + getCommand() + " " + getParameter());
/*  201 */         return 0;
       }
/*  203 */       StringBuilder sb = new StringBuilder();
/*  204 */       if (this.hellban) {
/*  205 */         sb.append("Banned ").append(splitted[1]).append(": ").append(StringUtil.joinStringFrom(splitted, 2));
       } else {
/*  207 */         sb.append(c.getPlayer().getName()).append(" banned ").append(splitted[1]).append(": ").append(StringUtil.joinStringFrom(splitted, 2));
       }
/*  209 */       MapleCharacter target = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  210 */       if (target != null) {
/*  211 */         if (c.getPlayer().getGMLevel() > target.getGMLevel() || c.getPlayer().isAdmin()) {
/*  212 */           sb.append(" (IP: ").append(target.getClient().getSessionIPAddress()).append(")");
/*  213 */           if (target.ban(sb.toString(), (this.hellban || this.ipBan), false, this.hellban)) {
/*  214 */             c.getPlayer().dropMessage(6, "[" + getCommand() + "] 已成功将玩家 " + splitted[1] + " 进行封号处理.");
/*  215 */             return 1;
           }
/*  217 */           c.getPlayer().dropMessage(6, "[" + getCommand() + "] 封号失败.");
/*  218 */           return 0;
         }

/*  221 */         c.getPlayer().dropMessage(6, "[" + getCommand() + "] 对方的管理权限比你高无法对其进行封号...");
/*  222 */         return 1;
       }

/*  225 */       if (MapleCharacter.ban(splitted[1], sb.toString(), false, c.getPlayer().getGMLevel(), this.hellban)) {
/*  226 */         c.getPlayer().dropMessage(6, "[" + getCommand() + "] 已成功将玩家 " + splitted[1] + " 进行离线封号.");
/*  227 */         return 1;
       }
/*  229 */       c.getPlayer().dropMessage(6, "[" + getCommand() + "] 离线封号失败 " + splitted[1]);
/*  230 */       return 0;
     }
   }




   public static class CC
     extends CommandExecute
   {
     public String getParameter() {
/*  241 */       return "<频道ID>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  246 */       if (splitted.length < 2) {
/*  247 */         c.getPlayer().dropMessage(6, "用法: !CC " + getParameter());
/*  248 */         return 0;
       }
/*  250 */       c.getPlayer().changeChannel(Integer.parseInt(splitted[1]));
/*  251 */       return 1;
     }
   }


   public static class CCPlayer
     extends CommandExecute
   {
     public String getParameter() {
/*  260 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  265 */       if (splitted.length < 2) {
/*  266 */         c.getPlayer().dropMessage(6, "用法: !CCPlayer " + getParameter());
/*  267 */         return 0;
       }
/*  269 */       c.getPlayer().changeChannel(WorldFindService.getInstance().findChannel(splitted[1]));
/*  270 */       return 1;
     }
   }


   public static class DC
     extends CommandExecute
   {
     public String getParameter() {
/*  279 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  284 */       if (splitted.length < 2) {
/*  285 */         c.getPlayer().dropMessage(6, "用法: !DC " + getParameter());
/*  286 */         return 0;
       }
/*  288 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[splitted.length - 1]);
/*  289 */       if (victim != null && c.getPlayer().getGMLevel() >= victim.getGMLevel()) {
/*  290 */         victim.getClient().disconnect(true, false);
/*  291 */         victim.getClient().getSession().close();
/*  292 */         c.getPlayer().dropMessage(6, "已经成功断开 " + victim.getName() + " 的连接.");
/*  293 */         return 1;
       }
/*  295 */       c.getPlayer().dropMessage(6, "使用的对象不存在或者角色名字错误或者对方的GM权限比你高.");
/*  296 */       return 0;
     }
   }



   public static class Kill
     extends CommandExecute
   {
     public String getParameter() {
/*  306 */       return "<角色名> //多个角色名使用空格来分隔";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  311 */       MapleCharacter player = c.getPlayer();
/*  312 */       if (splitted.length < 2) {
/*  313 */         c.getPlayer().dropMessage(6, "用法: !kill " + getParameter());
/*  314 */         return 0;
       }
/*  316 */       MapleCharacter victim = null;
/*  317 */       for (int i = 1; i < splitted.length; i++) {
         try {
/*  319 */           victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[i]);
/*  320 */         } catch (Exception e) {
/*  321 */           c.getPlayer().dropMessage(6, "没有找到名字为: " + splitted[i] + " 的玩家.");
         }
/*  323 */         if (player.allowedToTarget(victim) && player.getGMLevel() >= victim.getGMLevel()) {
/*  324 */           victim.updateSingleStat(MapleStat.HP, 0L);
/*  325 */           victim.updateSingleStat(MapleStat.MP, 0L);
/*  326 */           victim.getStat().setHp(0, victim);
/*  327 */           victim.getStat().setMp(0, victim);
/*  328 */           c.announce(EffectPacket.playerDeadConfirm(1, 0));
         }
       }
/*  331 */       return 1;
     }
   }


   public static class WhereAmI
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  340 */       c.getPlayer().dropMessage(5, "当前地图ID: " + c.getPlayer().getMap().getId());
/*  341 */       return 1;
     }
   }


   public static class ClearInv
     extends CommandExecute
   {
     public String getParameter() {
/*  350 */       return "<all/eqp/eq/u/s/e/c> //依次表示:全部/已装备/装备/消耗/设置/其他/特殊";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  355 */       Map<Pair<Short, Short>, MapleInventoryType> eqs = new HashMap<>();
/*  356 */       switch (splitted[1]) {
         case "all":
/*  358 */           for (MapleInventoryType type : MapleInventoryType.values()) {
/*  359 */             for (Item item : c.getPlayer().getInventory(type)) {
/*  360 */               eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), type);
             }
           }
           break;
         case "eqp":
/*  365 */           for (Item item : c.getPlayer().getInventory(MapleInventoryType.EQUIPPED)) {
/*  366 */             eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), MapleInventoryType.EQUIPPED);
           }
           break;
         case "eq":
/*  370 */           for (Item item : c.getPlayer().getInventory(MapleInventoryType.EQUIP)) {
/*  371 */             eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), MapleInventoryType.EQUIP);
           }
           break;
         case "u":
/*  375 */           for (Item item : c.getPlayer().getInventory(MapleInventoryType.USE)) {
/*  376 */             eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), MapleInventoryType.USE);
           }
           break;
         case "s":
/*  380 */           for (Item item : c.getPlayer().getInventory(MapleInventoryType.SETUP)) {
/*  381 */             eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), MapleInventoryType.SETUP);
           }
           break;
         case "e":
/*  385 */           for (Item item : c.getPlayer().getInventory(MapleInventoryType.ETC)) {
/*  386 */             eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), MapleInventoryType.ETC);
           }
           break;
         case "c":
/*  390 */           for (Item item : c.getPlayer().getInventory(MapleInventoryType.CASH)) {
/*  391 */             eqs.put(new Pair(Short.valueOf(item.getPosition()), Short.valueOf(item.getQuantity())), MapleInventoryType.CASH);
           }
           break;
         default:
/*  395 */           c.getPlayer().dropMessage(6, "用法: !ClearInv " + getParameter());
           break;
       }
/*  398 */       for (Map.Entry<Pair<Short, Short>, MapleInventoryType> eq : eqs.entrySet()) {
/*  399 */         MapleInventoryManipulator.removeFromSlot(c, eq.getValue(), ((Short)((Pair)eq.getKey()).left).shortValue(), ((Short)((Pair)eq.getKey()).right).shortValue(), false, false);
       }
/*  401 */       return 1;
     }
   }


   public static class channelonline
     extends CommandExecute
   {
     public String getParameter() {
/*  410 */       return "[频道ID]";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  415 */       int channel = c.getChannel();
/*  416 */       if (splitted.length > 1) {
/*  417 */         channel = Integer.parseInt(splitted[1]);
/*  418 */         if (ChannelServer.getInstance(channel) == null) {
/*  419 */           c.getPlayer().dropMessage(6, "输入的频道不存在");
         }
       }
/*  422 */       c.getPlayer().dropMessage(6, "频道在线 " + channel + ":");
/*  423 */       c.getPlayer().dropMessage(6, ChannelServer.getInstance(channel).getPlayerStorage().getOnlinePlayers(true));
/*  424 */       return 1;
     }
   }


   public static class ItemCheck
     extends CommandExecute
   {
     public String getParameter() {
/*  433 */       return "<玩家名字> <道具ID>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  438 */       if (splitted.length < 3 || splitted[1] == null || splitted[1].equals("") || splitted[2] == null || splitted[2].equals("")) {
/*  439 */         c.getPlayer().dropMessage(6, "用法: !itemcheck " + getParameter());
/*  440 */         return 0;
       }
/*  442 */       int item = Integer.parseInt(splitted[2]);
/*  443 */       MapleCharacter chr = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  444 */       int itemamount = chr.getItemQuantity(item, true);
/*  445 */       if (itemamount > 0) {
/*  446 */         c.getPlayer().dropMessage(6, chr.getName() + " 拥有 " + itemamount + " (" + item + ").");
       } else {
/*  448 */         c.getPlayer().dropMessage(6, chr.getName() + " 没有ID为 (" + item + ") 的道具.");
       }

/*  451 */       return 1;
     }
   }


   public static class Song
     extends CommandExecute
   {
     public String getParameter() {
/*  460 */       return "<资源路径>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  465 */       if (splitted.length < 2) {
/*  466 */         c.getPlayer().dropMessage(6, "用法: !Song " + getParameter());
/*  467 */         return 0;
       }
/*  469 */       c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.musicChange(splitted[1]));
/*  470 */       return 1;
     }
   }


   public static class CheckPoint
     extends CommandExecute
   {
     public String getParameter() {
/*  479 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  484 */       if (splitted.length < 2) {
/*  485 */         c.getPlayer().dropMessage(6, "用法: !CheckPoint " + getParameter());
/*  486 */         return 0;
       }
/*  488 */       MapleCharacter chrs = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  489 */       if (chrs == null) {
/*  490 */         c.getPlayer().dropMessage(6, "当前频道么有找到这个玩家.");
       } else {
/*  492 */         c.getPlayer().dropMessage(6, chrs.getName() + " 拥有 " + chrs.getPoints() + " 点.");
       }
/*  494 */       return 1;
     }
   }


   public static class CheckVPoint
     extends CommandExecute
   {
     public String getParameter() {
/*  503 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  508 */       if (splitted.length < 2) {
/*  509 */         c.getPlayer().dropMessage(6, "用法: !CheckVPoint " + getParameter());
/*  510 */         return 0;
       }
/*  512 */       MapleCharacter chrs = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  513 */       if (chrs == null) {
/*  514 */         c.getPlayer().dropMessage(6, "当前频道么有找到这个玩家");
       } else {
/*  516 */         c.getPlayer().dropMessage(6, chrs.getName() + " 拥有 " + chrs.getVPoints() + " 点.");
       }
/*  518 */       return 1;
     }
   }


   public static class PermWeather
     extends CommandExecute
   {
     public String getParameter() {
/*  527 */       return "<效果ID 默认:5120000>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  532 */       if (c.getPlayer().getMap().getPermanentWeather() > 0) {
/*  533 */         c.getPlayer().getMap().setPermanentWeather(0);
/*  534 */         c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.removeMapEffect());
/*  535 */         c.getPlayer().dropMessage(5, "当前地图的效果已禁止.");
       } else {
/*  537 */         int weather = CommandProcessorUtil.getOptionalIntArg(splitted, 1, 5120000);
/*  538 */         if (!MapleItemInformationProvider.getInstance().itemExists(weather) || weather / 10000 != 512) {
/*  539 */           c.getPlayer().dropMessage(5, "请输入ID.");
         } else {
/*  541 */           c.getPlayer().getMap().setPermanentWeather(weather);
/*  542 */           c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.startMapEffect("", weather, false));
/*  543 */           c.getPlayer().dropMessage(5, "当前地图的效果已开启.");
         }
       }
/*  546 */       return 1;
     }
   }


   public static class charinfo
     extends CommandExecute
   {
     public String getParameter() {
/*  555 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  560 */       if (splitted.length < 2) {
/*  561 */         c.getPlayer().dropMessage(6, "用法: !charinfo " + getParameter());
       }
/*  563 */       StringBuilder builder = new StringBuilder();
/*  564 */       MapleCharacter other = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  565 */       if (other == null) {
/*  566 */         builder.append("输入的角色不存在...");
/*  567 */         c.getPlayer().dropMessage(6, builder.toString());
/*  568 */         return 0;
       }
/*  570 */       builder.append(MapleClient.getLogMessage(other, ""));
/*  571 */       builder.append(" 坐标 ").append((other.getPosition()).x);
/*  572 */       builder.append(" /").append((other.getPosition()).y);

/*  574 */       builder.append(" || 血 : ");
/*  575 */       builder.append(other.getStat().getHp());
/*  576 */       builder.append(" /");
/*  577 */       builder.append(other.getStat().getCurrentMaxHp());

/*  579 */       builder.append(" || 蓝 : ");
/*  580 */       builder.append(other.getStat().getMp());
/*  581 */       builder.append(" /");
/*  582 */       builder.append(other.getStat().getCurrentMaxMp(other.getJob()));

/*  584 */       builder.append(" || 物理攻击力 : ");
/*  585 */       builder.append(other.getStat().getTotalWatk());
/*  586 */       builder.append(" || 魔法攻击力 : ");
/*  587 */       builder.append(other.getStat().getTotalMagic());
/*  588 */       builder.append(" || 最大攻击 : ");
/*  589 */       builder.append(other.getStat().getCurrentMaxBaseDamage());
/*  590 */       builder.append(" || 伤害% : ");
/*  591 */       builder.append(other.getStat().getDamageRate());
/*  592 */       builder.append(" || BOSS伤害% : ");
/*  593 */       builder.append(other.getStat().getBossDamageRate());
/*  594 */       builder.append(" || 爆击几率 : ");
/*  595 */       builder.append(other.getStat().passive_sharpeye_rate());
/*  596 */       builder.append(" || 暴击伤害 : ");
/*  597 */       builder.append(other.getStat().passive_sharpeye_percent());

/*  599 */       builder.append(" || 力量 : ");
/*  600 */       builder.append(other.getStat().getStr());
/*  601 */       builder.append(" || 敏捷 : ");
/*  602 */       builder.append(other.getStat().getDex());
/*  603 */       builder.append(" || 智力 : ");
/*  604 */       builder.append(other.getStat().getInt());
/*  605 */       builder.append(" || 运气 : ");
/*  606 */       builder.append(other.getStat().getLuk());

/*  608 */       builder.append(" || 全部力量 : ");
/*  609 */       builder.append(other.getStat().getTotalStr());
/*  610 */       builder.append(" || 全部敏捷 : ");
/*  611 */       builder.append(other.getStat().getTotalDex());
/*  612 */       builder.append(" || 全部智力 : ");
/*  613 */       builder.append(other.getStat().getTotalInt());
/*  614 */       builder.append(" || 全部运气 : ");
/*  615 */       builder.append(other.getStat().getTotalLuk());

/*  617 */       builder.append(" || 经验 : ");
/*  618 */       builder.append(other.getExp());
/*  619 */       builder.append(" || 金币 : ");
/*  620 */       builder.append(other.getMeso());

/*  622 */       builder.append(" || 是否组队 : ");
/*  623 */       builder.append((other.getParty() == null) ? -1 : other.getParty().getPartyId());

/*  625 */       builder.append(" || 是否交易: ");
/*  626 */       builder.append((other.getTrade() != null));
/*  627 */       builder.append(" || Latency: ");
/*  628 */       builder.append(other.getClient().getLatency());
/*  629 */       builder.append(" || PING: ");
/*  630 */       builder.append(other.getClient().getLastPing());
/*  631 */       builder.append(" || PONG: ");
/*  632 */       builder.append(other.getClient().getLastPong());

/*  634 */       c.getPlayer().dropMessage(6, builder.toString());
/*  635 */       return 1;
     }
   }


   public static class Reports
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  644 */       List<CheaterData> cheaters = World.getReports();
/*  645 */       for (int x = cheaters.size() - 1; x >= 0; x--) {
/*  646 */         CheaterData cheater = cheaters.get(x);
/*  647 */         c.getPlayer().dropMessage(6, cheater.getInfo());
       }
/*  649 */       return 1;
     }
   }

   public static class ClearReport
     extends CommandExecute
   {
     private String getReports() {
/*  657 */       StringBuilder ret = new StringBuilder("<all/");
/*  658 */       for (ReportType type : ReportType.values()) {
/*  659 */         ret.append(type.theId).append('/');
       }
/*  661 */       ret.setLength(ret.length() - 1);
/*  662 */       return ret.append('>').toString();
     }


     public String getParameter() {
/*  667 */       return "<角色名> " + getReports();
     }


     public int execute(MapleClient c, String[] splitted) {
/*  672 */       if (splitted.length < 3) {
/*  673 */         c.getPlayer().dropMessage(6, "用法: !ClearReport " + getReports());
/*  674 */         return 0;
       }
/*  676 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/*  677 */       if (victim == null) {
/*  678 */         c.getPlayer().dropMessage(5, "输入的角色不存在...");
/*  679 */         return 0;
       }
/*  681 */       ReportType type = ReportType.getByString(splitted[2]);
/*  682 */       if (type != null) {
/*  683 */         victim.clearReports(type);
       } else {
/*  685 */         victim.clearReports();
       }
/*  687 */       c.getPlayer().dropMessage(5, "完成.");
/*  688 */       return 1;
     }
   }


   public static class checkcheat
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  697 */       List<CheaterData> cheaters = World.getCheaters();
/*  698 */       for (int x = cheaters.size() - 1; x >= 0; x--) {
/*  699 */         CheaterData cheater = cheaters.get(x);
/*  700 */         c.getPlayer().dropMessage(6, cheater.getInfo());
       }
/*  702 */       return 1;
     }
   }


   public static class onlineall
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  711 */       Map<Integer, Integer> connected = World.getConnected();
/*  712 */       StringBuilder conStr = new StringBuilder("在线人数: ");
/*  713 */       boolean first = true;
/*  714 */       for (Iterator<Integer> iterator = connected.keySet().iterator(); iterator.hasNext(); ) { int i = ((Integer)iterator.next()).intValue();
/*  715 */         if (!first) {
/*  716 */           conStr.append(", ");
         } else {
/*  718 */           first = false;
         }
/*  720 */         if (i == 0) {
/*  721 */           conStr.append("总计: ");
/*  722 */           conStr.append(connected.get(Integer.valueOf(i))); continue;
/*  723 */         }  if (i == -10) {
/*  724 */           conStr.append("商城: ");
/*  725 */           conStr.append(connected.get(Integer.valueOf(i))); continue;
         }
/*  727 */         conStr.append("频道");
/*  728 */         conStr.append(i);
/*  729 */         conStr.append(": ");
/*  730 */         conStr.append(connected.get(Integer.valueOf(i))); }


/*  733 */       c.getPlayer().dropMessage(6, conStr.toString());
/*  734 */       return 1;
     }
   }


   public static class NearestPortal
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  743 */       MaplePortal portal = c.getPlayer().getMap().findClosestPortal(c.getPlayer().getTruePosition());
/*  744 */       c.getPlayer().dropMessage(6, portal.getName() + " id: " + portal.getId() + " script: " + portal.getScriptName());
/*  745 */       return 1;
     }
   }


   public static class SpawnDebug
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  754 */       c.getPlayer().dropMessage(6, c.getPlayer().getMap().spawnDebug());
/*  755 */       return 1;
     }
   }


   public static class FakeRelog
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  764 */       c.getPlayer().fakeRelog();
/*  765 */       return 1;
     }
   }


   public static class RemoveDrops
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  774 */       c.getPlayer().dropMessage(5, "已成功将当前地图的 " + c.getPlayer().getMap().getNumItems() + " 个道具清除.");
/*  775 */       c.getPlayer().getMap().removeDrops();
/*  776 */       return 1;
     }
   }


   public static class ListSquads
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  785 */       for (Map.Entry<MapleSquadType, MapleSquad> squads : (Iterable<Map.Entry<MapleSquadType, MapleSquad>>)c.getChannelServer().getAllSquads().entrySet()) {
/*  786 */         c.getPlayer().dropMessage(5, "类型: " + ((MapleSquadType)squads.getKey()).name() + ", 队长: " + ((MapleSquad)squads.getValue()).getLeader().getName() + ", 状态: " + ((MapleSquad)squads.getValue()).getStatus() + ", 注册成员数量: " + ((MapleSquad)squads.getValue()).getSquadSize() + ", 禁止成员数量: " + ((MapleSquad)squads.getValue()).getBannedMemberSize());
       }
/*  788 */       return 0;
     }
   }


   public static class ListInstances
     extends CommandExecute
   {
     public String getParameter() {
/*  797 */       return "[事件名]";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  802 */       EventManager em = c.getChannelServer().getEventSM().getEventManager(StringUtil.joinStringFrom(splitted, 1));
/*  803 */       if (em == null || em.getInstances().size() <= 0) {
/*  804 */         c.getPlayer().dropMessage(5, "没有找到.");
       } else {
/*  806 */         for (EventInstanceManager eim : em.getInstances()) {
/*  807 */           c.getPlayer().dropMessage(5, "Event " + eim.getName() + ", charSize: " + eim.getPlayers().size() + ", dcedSize: " + eim.getDisconnected().size() + ", mobSize: " + eim.getMobs().size() + ", eventManager: " + em.getName() + ", timeLeft: " + eim.getTimeLeft() + ", iprops: " + eim.getProperties().toString() + ", eprops: " + em.getProperties().toString());
         }
       }
/*  810 */       return 0;
     }
   }


   public static class Uptime
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  819 */       c.getPlayer().dropMessage(6, "Server has been up for " + StringUtil.getReadableMillis(ChannelServer.serverStartTime, System.currentTimeMillis()));
/*  820 */       return 1;
     }
   }


   public static class EventInstance
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  829 */       if (c.getPlayer().getEventInstance() == null) {
/*  830 */         c.getPlayer().dropMessage(5, "没有找到.");
       } else {
/*  832 */         EventInstanceManager eim = c.getPlayer().getEventInstance();
/*  833 */         c.getPlayer().dropMessage(5, "Event " + eim.getName() + ", charSize: " + eim.getPlayers().size() + ", dcedSize: " + eim.getDisconnected().size() + ", mobSize: " + eim.getMobs().size() + ", eventManager: " + eim.getEventManager().getName() + ", timeLeft: " + eim.getTimeLeft() + ", iprops: " + eim.getProperties().toString() + ", eprops: " + eim.getEventManager().getProperties().toString());
       }
/*  835 */       return 1;
     }
   }

   public static class GoTo
     extends CommandExecute
   {
/*  842 */     private static final HashMap<String, Integer> gotomaps = new HashMap<>();

     static {
/*  845 */       gotomaps.put("gmmap", Integer.valueOf(180000000));
/*  846 */       gotomaps.put("southperry", Integer.valueOf(2000000));
/*  847 */       gotomaps.put("amherst", Integer.valueOf(1010000));
/*  848 */       gotomaps.put("henesys", Integer.valueOf(100000000));
/*  849 */       gotomaps.put("ellinia", Integer.valueOf(101000000));
/*  850 */       gotomaps.put("perion", Integer.valueOf(102000000));
/*  851 */       gotomaps.put("kerning", Integer.valueOf(103000000));
/*  852 */       gotomaps.put("harbor", Integer.valueOf(104000000));
/*  853 */       gotomaps.put("sleepywood", Integer.valueOf(105000000));
/*  854 */       gotomaps.put("florina", Integer.valueOf(120000300));
/*  855 */       gotomaps.put("orbis", Integer.valueOf(200000000));
/*  856 */       gotomaps.put("happyville", Integer.valueOf(209000000));
/*  857 */       gotomaps.put("elnath", Integer.valueOf(211000000));
/*  858 */       gotomaps.put("ludibrium", Integer.valueOf(220000000));
/*  859 */       gotomaps.put("aquaroad", Integer.valueOf(230000000));
/*  860 */       gotomaps.put("leafre", Integer.valueOf(240000000));
/*  861 */       gotomaps.put("mulung", Integer.valueOf(250000000));
/*  862 */       gotomaps.put("herbtown", Integer.valueOf(251000000));
/*  863 */       gotomaps.put("omegasector", Integer.valueOf(221000000));
/*  864 */       gotomaps.put("koreanfolktown", Integer.valueOf(222000000));
/*  865 */       gotomaps.put("newleafcity", Integer.valueOf(600000000));
/*  866 */       gotomaps.put("sharenian", Integer.valueOf(990000000));
/*  867 */       gotomaps.put("pianus", Integer.valueOf(230040420));
/*  868 */       gotomaps.put("horntail", Integer.valueOf(240060200));
/*  869 */       gotomaps.put("chorntail", Integer.valueOf(240060201));
/*  870 */       gotomaps.put("griffey", Integer.valueOf(240020101));
/*  871 */       gotomaps.put("manon", Integer.valueOf(240020401));
/*  872 */       gotomaps.put("zakum", Integer.valueOf(280030100));
/*  873 */       gotomaps.put("czakum", Integer.valueOf(280030001));
/*  874 */       gotomaps.put("papulatus", Integer.valueOf(220080001));
/*  875 */       gotomaps.put("showatown", Integer.valueOf(801000000));
/*  876 */       gotomaps.put("zipangu", Integer.valueOf(800000000));
/*  877 */       gotomaps.put("ariant", Integer.valueOf(260000100));
/*  878 */       gotomaps.put("nautilus", Integer.valueOf(120000000));
/*  879 */       gotomaps.put("boatquay", Integer.valueOf(541000000));
/*  880 */       gotomaps.put("malaysia", Integer.valueOf(550000000));
/*  881 */       gotomaps.put("erev", Integer.valueOf(130000000));
/*  882 */       gotomaps.put("ellin", Integer.valueOf(300000000));
/*  883 */       gotomaps.put("kampung", Integer.valueOf(551000000));
/*  884 */       gotomaps.put("singapore", Integer.valueOf(540000000));
/*  885 */       gotomaps.put("amoria", Integer.valueOf(680000000));
/*  886 */       gotomaps.put("timetemple", Integer.valueOf(270000000));
/*  887 */       gotomaps.put("pinkbean", Integer.valueOf(270050100));
/*  888 */       gotomaps.put("fm", Integer.valueOf(910000000));
/*  889 */       gotomaps.put("freemarket", Integer.valueOf(910000000));
/*  890 */       gotomaps.put("oxquiz", Integer.valueOf(109020001));
/*  891 */       gotomaps.put("ola", Integer.valueOf(109030101));
/*  892 */       gotomaps.put("fitness", Integer.valueOf(109040000));
/*  893 */       gotomaps.put("snowball", Integer.valueOf(109060000));
/*  894 */       gotomaps.put("golden", Integer.valueOf(950100000));
/*  895 */       gotomaps.put("phantom", Integer.valueOf(610010000));
/*  896 */       gotomaps.put("cwk", Integer.valueOf(610030000));
/*  897 */       gotomaps.put("rien", Integer.valueOf(140000000));
/*  898 */       gotomaps.put("edel", Integer.valueOf(310000000));
/*  899 */       gotomaps.put("ardent", Integer.valueOf(910001000));
/*  900 */       gotomaps.put("craft", Integer.valueOf(910001000));
/*  901 */       gotomaps.put("pvp", Integer.valueOf(960000000));
/*  902 */       gotomaps.put("future", Integer.valueOf(271000000));
     }


     public String getParameter() {
/*  907 */       return "<地图名称>";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  912 */       if (splitted.length < 2) {
/*  913 */         c.getPlayer().dropMessage(6, "用法: !goto " + getParameter());
       }
/*  915 */       else if (gotomaps.containsKey(splitted[1])) {
/*  916 */         MapleMap target = c.getChannelServer().getMapFactory().getMap(((Integer)gotomaps.get(splitted[1])).intValue());
/*  917 */         if (target == null) {
/*  918 */           c.getPlayer().dropMessage(6, "输入的地图不存在.");
/*  919 */           return 0;
         }
/*  921 */         MaplePortal targetPortal = target.getPortal(0);
/*  922 */         c.getPlayer().changeMap(target, targetPortal);
       }
/*  924 */       else if (splitted[1].equals("locations")) {
/*  925 */         c.getPlayer().dropMessage(6, "Use !goto <location>. Locations are as follows:");
/*  926 */         StringBuilder sb = new StringBuilder();
/*  927 */         for (String s : gotomaps.keySet()) {
/*  928 */           sb.append(s).append(", ");
         }
/*  930 */         c.getPlayer().dropMessage(6, sb.substring(0, sb.length() - 2));
       } else {
/*  932 */         c.getPlayer().dropMessage(6, "Invalid command syntax - Use !goto <location>. For a list of locations, use !goto locations.");
       }


/*  936 */       return 1;
     }
   }


   public static class MonsterDebug
     extends CommandExecute
   {
     public String getParameter() {
/*  945 */       return "<范围值> [地图ID]";
     }


     public int execute(MapleClient c, String[] splitted) {
/*  950 */       MapleMap map = c.getPlayer().getMap();
/*  951 */       double range = Double.POSITIVE_INFINITY;

/*  953 */       if (splitted.length > 1) {

/*  955 */         int irange = Integer.parseInt(splitted[1]);
/*  956 */         if (splitted.length <= 2) {
/*  957 */           range = (irange * irange);
         } else {
/*  959 */           map = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(splitted[2]));
         }
       }
/*  962 */       if (map == null) {
/*  963 */         c.getPlayer().dropMessage(6, "输入的地图ID无效.");
/*  964 */         return 0;
       }

/*  967 */       for (MapleMapObject monstermo : map.getMapObjectsInRange(c.getPlayer().getPosition(), range, Collections.singletonList(MapleMapObjectType.MONSTER))) {
/*  968 */         MapleMonster mob = (MapleMonster)monstermo;
/*  969 */         c.getPlayer().dropMessage(6, "怪物: " + mob.toString());
       }
/*  971 */       return 1;
     }
   }


   public static class seenpc
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  980 */       for (MapleMapObject reactor1l : c.getPlayer().getMap().getAllNPCsThreadsafe()) {
/*  981 */         MapleNPC reactor2l = (MapleNPC)reactor1l;
/*  982 */         c.getPlayer().dropMessage(5, "NPC信息: 工作ID: " + reactor2l.getObjectId() + " npcID: " + reactor2l.getId() + " 位置: " + reactor2l.getPosition().toString() + " 名字: " + reactor2l.getName());
       }
/*  984 */       return 0;
     }
   }


   public static class seereactor
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/*  993 */       for (MapleMapObject reactor1l : c.getPlayer().getMap().getAllReactorsThreadsafe()) {
/*  994 */         MapleReactor reactor2l = (MapleReactor)reactor1l;
/*  995 */         c.getPlayer().dropMessage(5, "反应堆信息: 工作ID: " + reactor2l.getObjectId() + " reactorID: " + reactor2l.getReactorId() + " 位置: " + reactor2l.getPosition().toString() + " 状态: " + reactor2l.getState() + " 名字: " + reactor2l.getName());
       }
/*  997 */       return 0;
     }
   }


   public static class seeportal
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/* 1006 */       for (MaplePortal portal : c.getPlayer().getMap().getPortals()) {
/* 1007 */         c.getPlayer().dropMessage(5, "传送门信息: ID: " + portal.getId() + " script: " + portal.getScriptName() + " name: " + portal.getName() + " pos: " + (portal.getPosition()).x + "," + (portal.getPosition()).y + " target: " + portal.getTargetMapId() + " / " + portal.getTarget());
       }
/* 1009 */       return 0;
     }
   }


   public static class MyNPCPos
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/* 1018 */       Point pos = c.getPlayer().getPosition();
/* 1019 */       c.getPlayer().dropMessage(6, "X: " + pos.x + " | Y: " + pos.y + " | RX0: " + (pos.x + 50) + " | RX1: " + (pos.x - 50) + " | FH: " + c.getPlayer().getFH());
/* 1020 */       return 1;
     }
   }


   public static class Clock
     extends CommandExecute
   {
     public String getParameter() {
/* 1029 */       return "<秒数>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1034 */       c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getClock(CommandProcessorUtil.getOptionalIntArg(splitted, 1, 60)));
/* 1035 */       return 1;
     }
   }


   public static class WarpHere
     extends CommandExecute
   {
     public String getParameter() {
/* 1044 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1049 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/* 1050 */       if (victim != null) {
/* 1051 */         if (c.getPlayer().inPVP() || (!c.getPlayer().isGM() && (victim.isInBlockedMap() || victim.isGM()))) {
/* 1052 */           c.getPlayer().dropMessage(5, "请稍后在试.");
/* 1053 */           return 0;
         }
/* 1055 */         victim.changeMap(c.getPlayer().getMap(), c.getPlayer().getMap().findClosestPortal(c.getPlayer().getTruePosition()));
       } else {
/* 1057 */         int ch = WorldFindService.getInstance().findChannel(splitted[1]);
/* 1058 */         if (ch < 0) {
/* 1059 */           c.getPlayer().dropMessage(5, "没有找到玩家[" + splitted[1] + "],请确认玩家是否在线或者输入的角色名字是否正确.");
/* 1060 */           return 0;
         }
/* 1062 */         victim = ChannelServer.getInstance(ch).getPlayerStorage().getCharacterByName(splitted[1]);
/* 1063 */         if (victim == null || victim.inPVP() || (!c.getPlayer().isGM() && (victim.isInBlockedMap() || victim.isGM()))) {
/* 1064 */           c.getPlayer().dropMessage(5, "请稍后在试.");
/* 1065 */           return 0;
         }
/* 1067 */         c.getPlayer().dropMessage(5, "Victim is cross changing channel.");
/* 1068 */         victim.dropMessage(5, "Cross changing channel.");
/* 1069 */         if (victim.getMapId() != c.getPlayer().getMapId()) {
/* 1070 */           MapleMap mapp = victim.getClient().getChannelServer().getMapFactory().getMap(c.getPlayer().getMapId());
/* 1071 */           victim.changeMap(mapp, mapp.findClosestPortal(c.getPlayer().getTruePosition()));
         }
/* 1073 */         victim.changeChannel(c.getChannel());
       }
/* 1075 */       return 1;
     }
   }


   public static class WarpHereAll
     extends CommandExecute
   {
     public String getParameter() {
/* 1084 */       return "[*] //填写任意值表示无条件将所有玩家移动到身边";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1089 */       boolean all = (splitted.length > 1);
/* 1090 */       for (ChannelServer cs : ChannelServer.getAllInstances()) {
/* 1091 */         for (MapleCharacter chr : cs.getPlayerStorage().getAllCharacters()) {
/* 1092 */           if (chr == null || chr.isGM() || (chr.isInBlockedMap() && !all)) {
             continue;
           }
/* 1095 */           chr.changeMap(c.getPlayer().getMap(), c.getPlayer().getMap().findClosestPortal(c.getPlayer().getTruePosition()));
/* 1096 */           chr.dropMessage(5, "您已被GM传送于此。");
/* 1097 */           if (chr.getClient().getChannel() != c.getChannel()) {
/* 1098 */             chr.changeChannel(c.getChannel());
           }
         }
       }
/* 1102 */       return 1;
     }
   }


   public static class WarpId
     extends CommandExecute
   {
     public String getParameter() {
/* 1111 */       return "<角色ID>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1116 */       if (splitted.length < 2) {
/* 1117 */         c.getPlayer().dropMessage(6, "用法: !WarpId " + getParameter());
/* 1118 */         return 0;
       }
/* 1120 */       int victimId = Integer.parseInt(splitted[1]);
/* 1121 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterById(victimId);
/* 1122 */       if (victim != null) {
/* 1123 */         c.getPlayer().changeMap(victim.getMap(), victim.getMap().findClosestSpawnpoint(victim.getTruePosition()));
       } else {
/* 1125 */         int ch = WorldFindService.getInstance().findChannel(victimId);
/* 1126 */         if (ch <= 0) {
/* 1127 */           c.getPlayer().dropMessage(6, "找不到该角色ID为: " + victimId + " 的信息.");
/* 1128 */           return 0;
         }
/* 1130 */         victim = ChannelServer.getInstance(ch).getPlayerStorage().getCharacterById(victimId);
/* 1131 */         if (victim != null) {
/* 1132 */           c.getPlayer().dropMessage(6, "正在切换频道，请等待...");
/* 1133 */           if (victim.getMapId() != c.getPlayer().getMapId()) {
/* 1134 */             MapleMap mapp = c.getChannelServer().getMapFactory().getMap(victim.getMapId());
/* 1135 */             c.getPlayer().changeMap(mapp, mapp.findClosestPortal(victim.getTruePosition()));
           }
/* 1137 */           c.getPlayer().changeChannel(ch);
         }
       }
/* 1140 */       return 1;
     }
   }


   public static class Warp
     extends CommandExecute
   {
     public String getParameter() {
/* 1149 */       return "<地图ID> [地图传送点] 或 <角色名> [地图ID] [地图传送点]";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1154 */       if (splitted.length < 2) {
/* 1155 */         c.getPlayer().dropMessage(6, "用法: !warp " + getParameter());
/* 1156 */         return 0;
       }
/* 1158 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/* 1159 */       if (victim != null && c.getPlayer().getGMLevel() >= victim.getGMLevel() && !victim.inPVP() && !c.getPlayer().inPVP()) {
/* 1160 */         if (splitted.length == 2) {
/* 1161 */           c.getPlayer().changeMap(victim.getMap(), victim.getMap().findClosestSpawnpoint(victim.getTruePosition()));
         } else {
/* 1163 */           MapleMap target = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(Integer.parseInt(splitted[2]));
/* 1164 */           if (target == null) {
/* 1165 */             c.getPlayer().dropMessage(6, "输入的地图不存在.");
/* 1166 */             return 0;
           }
/* 1168 */           MaplePortal targetPortal = null;
/* 1169 */           if (splitted.length > 3) {
             try {
/* 1171 */               targetPortal = target.getPortal(Integer.parseInt(splitted[3]));
/* 1172 */             } catch (IndexOutOfBoundsException e) {

/* 1174 */               c.getPlayer().dropMessage(5, "Invalid portal selected.");
/* 1175 */             } catch (NumberFormatException numberFormatException) {}
           }


/* 1179 */           if (targetPortal == null) {
/* 1180 */             targetPortal = target.getPortal(0);
           }
/* 1182 */           victim.changeMap(target, targetPortal);
         }
       } else {
         try {
/* 1186 */           victim = c.getPlayer();
/* 1187 */           int ch = WorldFindService.getInstance().findChannel(splitted[1]);
/* 1188 */           if (ch < 0) {
/* 1189 */             MapleMap target = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(splitted[1]));
/* 1190 */             if (target == null) {
/* 1191 */               c.getPlayer().dropMessage(6, "输入的地图不存在.");
/* 1192 */               return 0;
             }
/* 1194 */             MaplePortal targetPortal = null;
/* 1195 */             if (splitted.length > 2) {
               try {
/* 1197 */                 targetPortal = target.getPortal(Integer.parseInt(splitted[2]));
/* 1198 */               } catch (IndexOutOfBoundsException e) {

/* 1200 */                 c.getPlayer().dropMessage(5, "Invalid portal selected.");
/* 1201 */               } catch (NumberFormatException numberFormatException) {}
             }


/* 1205 */             if (targetPortal == null) {
/* 1206 */               targetPortal = target.getPortal(0);
             }
/* 1208 */             c.getPlayer().changeMap(target, targetPortal);
           } else {
/* 1210 */             victim = ChannelServer.getInstance(ch).getPlayerStorage().getCharacterByName(splitted[1]);
/* 1211 */             c.getPlayer().dropMessage(6, "正在切换频道，请等待...");
/* 1212 */             if (victim.getMapId() != c.getPlayer().getMapId()) {
/* 1213 */               MapleMap mapp = c.getChannelServer().getMapFactory().getMap(victim.getMapId());
/* 1214 */               c.getPlayer().changeMap(mapp, mapp.findClosestPortal(victim.getTruePosition()));
             }
/* 1216 */             c.getPlayer().changeChannel(ch);
           }
/* 1218 */         } catch (Exception e) {
/* 1219 */           c.getPlayer().dropMessage(6, "出现错误: " + e.getMessage());
/* 1220 */           return 0;
         }
       }
/* 1223 */       return 1;
     }
   }


   public static class detention
     extends CommandExecute
   {
     public String getParameter() {
/* 1232 */       return "<玩家名字> <多少分钟, 0 = 永久>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1237 */       if (splitted.length < 3) {
/* 1238 */         c.getPlayer().dropMessage(6, "用法: !监禁 " + getParameter());
/* 1239 */         return 0;
       }
/* 1241 */       MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/* 1242 */       int minutes = Math.max(0, Integer.parseInt(splitted[2]));
/* 1243 */       if (victim != null && c.getPlayer().getGMLevel() >= victim.getGMLevel()) {
/* 1244 */         MapleMap target = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(180000001);
/* 1245 */         victim.getQuestNAdd(MapleQuest.getInstance(123456)).setCustomData(String.valueOf(minutes * 60));
/* 1246 */         victim.changeMap(target, target.getPortal(0));
/* 1247 */         victim.gainWarning(true);
       } else {
/* 1249 */         c.getPlayer().dropMessage(6, "请确保要监禁的玩家处于在线状态.");
/* 1250 */         return 0;
       }
/* 1252 */       return 1;
     }
   }


   public static class ListAllSquads
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/* 1261 */       for (ChannelServer cserv : ChannelServer.getAllInstances()) {
/* 1262 */         for (Map.Entry<MapleSquadType, MapleSquad> squads : (Iterable<Map.Entry<MapleSquadType, MapleSquad>>)cserv.getAllSquads().entrySet()) {
/* 1263 */           c.getPlayer().dropMessage(5, "[频道 " + cserv.getChannel() + "] 类型: " + ((MapleSquadType)squads.getKey()).name() + ", 队长: " + ((MapleSquad)squads.getValue()).getLeader().getName() + ", 状态: " + ((MapleSquad)squads.getValue()).getStatus() + ", 成员总数: " + ((MapleSquad)squads.getValue()).getSquadSize() + ", 拒绝成员总数: " + ((MapleSquad)squads.getValue()).getBannedMemberSize());
         }
       }
/* 1266 */       return 1;
     }
   }


   public static class Say
     extends CommandExecute
   {
     public String getParameter() {
/* 1275 */       return "<文本内容>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1280 */       if (splitted.length > 1) {
/* 1281 */         StringBuilder sb = new StringBuilder();
/* 1282 */         sb.append("[");
/* 1283 */         if (!c.getPlayer().isGM()) {
/* 1284 */           sb.append("管理员 ");
         }
/* 1286 */         sb.append(c.getPlayer().getName());
/* 1287 */         sb.append("] ");
/* 1288 */         sb.append(StringUtil.joinStringFrom(splitted, 1));
/* 1289 */         WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(c.getPlayer().isGM() ? 6 : 5, sb.toString()));
       } else {
/* 1291 */         c.getPlayer().dropMessage(6, "用法: !say " + getParameter());
/* 1292 */         return 0;
       }
/* 1294 */       return 1;
     }
   }


   public static class Letter
     extends CommandExecute
   {
     public String getParameter() {
/* 1303 */       return "<颜色 (green/red)> <文本内容>";
     }

     public int execute(MapleClient c, String[] splitted) {
       int start, nstart;
/* 1308 */       if (splitted.length < 3) {
/* 1309 */         c.getPlayer().dropMessage(6, "用法: !letter " + getParameter());
/* 1310 */         return 0;
       }

/* 1313 */       if (splitted[1].equalsIgnoreCase("green")) {
/* 1314 */         start = 3991026;
/* 1315 */         nstart = 3990019;
/* 1316 */       } else if (splitted[1].equalsIgnoreCase("red")) {
/* 1317 */         start = 3991000;
/* 1318 */         nstart = 3990009;
       } else {
/* 1320 */         c.getPlayer().dropMessage(6, "未知的颜色!");
/* 1321 */         return 0;
       }
/* 1323 */       String splitString = StringUtil.joinStringFrom(splitted, 2);
/* 1324 */       List<Integer> chars = new ArrayList<>();
/* 1325 */       splitString = splitString.toUpperCase();

/* 1327 */       for (int i = 0; i < splitString.length(); i++) {
/* 1328 */         char chr = splitString.charAt(i);
/* 1329 */         if (chr == ' ') {
/* 1330 */           chars.add(Integer.valueOf(-1));
/* 1331 */         } else if (chr >= 'A' && chr <= 'Z') {
/* 1332 */           chars.add(Integer.valueOf(chr));
/* 1333 */         } else if (chr >= '0' && chr <= '9') {
/* 1334 */           chars.add(Integer.valueOf(chr + 200));
         }
       }
/* 1337 */       int w = 32;
/* 1338 */       int dStart = (c.getPlayer().getPosition()).x - splitString.length() / 2 * 32;
/* 1339 */       for (Integer integer : chars) {
/* 1340 */         if (integer.intValue() == -1) {
/* 1341 */           dStart += 32; continue;
/* 1342 */         }  if (integer.intValue() < 200) {
/* 1343 */           int val = start + integer.intValue() - 65;
/* 1344 */           Item item = new Item(val, (short)0, (short)1);
/* 1345 */           c.getPlayer().getMap().spawnItemDrop((MapleMapObject)c.getPlayer(), c.getPlayer(), item, new Point(dStart, (c.getPlayer().getPosition()).y), false, false);
/* 1346 */           dStart += 32; continue;
/* 1347 */         }  if (integer.intValue() >= 200 && integer.intValue() <= 300) {
/* 1348 */           int val = nstart + integer.intValue() - 48 - 200;
/* 1349 */           Item item = new Item(val, (short)0, (short)1);
/* 1350 */           c.getPlayer().getMap().spawnItemDrop((MapleMapObject)c.getPlayer(), c.getPlayer(), item, new Point(dStart, (c.getPlayer().getPosition()).y), false, false);
/* 1351 */           dStart += 32;
         }
       }
/* 1354 */       return 1;
     }
   }




   public static class Find
     extends CommandExecute
   {
/* 1364 */     private static Map<Integer, String> allNpcNames = MapleLifeFactory.getAllNpcName();
/* 1365 */     private static Map<Integer, String> allMapNames = MapleMapFactory.getAllMapName();
/* 1366 */     private static Map<Integer, String> allMobNames = MapleLifeFactory.getAllMonsterName();



     public String getParameter() {
/* 1371 */       return "<NPC/MOB/ITEM/MAP/SKILL/QUEST> <关键词>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1376 */       if (splitted.length < 3) {
/* 1377 */         c.getPlayer().dropMessage(6, "用法 !find " + getParameter());
       } else {
/* 1379 */         String type = splitted[1];
/* 1380 */         String search = StringUtil.joinStringFrom(splitted, 2);
/* 1381 */         c.getPlayer().dropMessage(6, "<<Type: " + type + " | Search: " + search + ">>");

/* 1383 */         if (type.equalsIgnoreCase("NPC")) {
/* 1384 */           List<String> retNpcs = new ArrayList<>();
/* 1385 */           allNpcNames.entrySet().parallelStream()
/* 1386 */             .filter(stringEntry -> ((String)stringEntry.getValue()).toLowerCase().contains(search.toLowerCase()))
/* 1387 */             .forEach(entry -> retNpcs.add((new StringBuilder()).append(entry.getKey()).append(" - ").append((String)entry.getValue()).toString()));
/* 1388 */           if (retNpcs.size() > 0) {
/* 1389 */             for (String singleRetNpc : retNpcs) {
/* 1390 */               c.getPlayer().dropMessage(6, singleRetNpc);
             }
           } else {
/* 1393 */             c.getPlayer().dropMessage(6, "没有找到相关信息");
           }
/* 1395 */         } else if (type.equalsIgnoreCase("MAP")) {
/* 1396 */           List<String> retMaps = new ArrayList<>();
/* 1397 */           allMapNames.entrySet().parallelStream()
/* 1398 */             .filter(stringEntry -> ((String)stringEntry.getValue()).toLowerCase().contains(search.toLowerCase()))
/* 1399 */             .forEach(entry -> retMaps.add((new StringBuilder()).append(entry.getKey()).append(" - ").append((String)entry.getValue()).toString()));
/* 1400 */           if (retMaps.size() > 0) {
/* 1401 */             for (String singleRetMap : retMaps) {
/* 1402 */               c.getPlayer().dropMessage(6, singleRetMap);
             }
           } else {
/* 1405 */             c.getPlayer().dropMessage(6, "没有找到相关信息");
           }
/* 1407 */         } else if (type.equalsIgnoreCase("MOB")) {
/* 1408 */           List<String> retMobs = new ArrayList<>();
/* 1409 */           allMobNames.entrySet().parallelStream()
/* 1410 */             .filter(stringEntry -> ((String)stringEntry.getValue()).toLowerCase().contains(search.toLowerCase()))
/* 1411 */             .forEach(entry -> retMobs.add((new StringBuilder()).append(entry.getKey()).append(" - ").append((String)entry.getValue()).toString()));
/* 1412 */           if (retMobs.size() > 0) {
/* 1413 */             for (String singleRetMob : retMobs) {
/* 1414 */               c.getPlayer().dropMessage(6, singleRetMob);
             }
           } else {
/* 1417 */             c.getPlayer().dropMessage(6, "没有找到相关信息");
           }

/* 1420 */         } else if (type.equalsIgnoreCase("ITEM")) {
/* 1421 */           List<String> retItems = new ArrayList<>();
/* 1422 */           for (Map.Entry<Integer, String> entry : (Iterable<Map.Entry<Integer, String>>)MapleItemInformationProvider.getInstance().getAllItemNames().entrySet()) {
/* 1423 */             if (((String)entry.getValue()).toLowerCase().contains(search.toLowerCase())) {
/* 1424 */               retItems.add((new StringBuilder()).append(entry.getKey()).append(" - ").append(entry.getValue()).toString());
             }
           }
/* 1427 */           if (retItems.size() > 0) {
/* 1428 */             for (String singleRetItem : retItems) {
/* 1429 */               c.getPlayer().dropMessage(6, singleRetItem);
             }
           } else {
/* 1432 */             c.getPlayer().dropMessage(6, "没有找到相关信息");
           }
/* 1434 */         } else if (type.equalsIgnoreCase("QUEST")) {
/* 1435 */           List<String> retItems = new ArrayList<>();
/* 1436 */           for (MapleQuest itemPair : MapleQuest.getAllInstances()) {
/* 1437 */             if (itemPair.getName().length() > 0 && itemPair.getName().toLowerCase().contains(search.toLowerCase())) {
/* 1438 */               retItems.add(itemPair.getId() + " - " + itemPair.getName());
             }
           }
/* 1441 */           if (retItems.size() > 0) {
/* 1442 */             for (String singleRetItem : retItems) {
/* 1443 */               c.getPlayer().dropMessage(6, singleRetItem);
             }
           } else {
/* 1446 */             c.getPlayer().dropMessage(6, "没有找到相关信息");
           }
/* 1448 */         } else if (type.equalsIgnoreCase("SKILL")) {
/* 1449 */           List<String> retSkills = new ArrayList<>();
/* 1450 */           for (Map.Entry<Integer, String> skil : (Iterable<Map.Entry<Integer, String>>)SkillFactory.getAllSkills().entrySet()) {
/* 1451 */             if (skil.getValue() != null && ((String)skil.getValue()).toLowerCase().contains(search.toLowerCase())) {
/* 1452 */               retSkills.add((new StringBuilder()).append(skil.getKey()).append(" - ").append(skil.getValue()).toString());
             }
           }
/* 1455 */           if (!retSkills.isEmpty()) {
/* 1456 */             for (String singleRetSkill : retSkills) {
/* 1457 */               c.getPlayer().dropMessage(6, singleRetSkill);
             }
           } else {
/* 1460 */             c.getPlayer().dropMessage(6, "没有找到相关信息");
           }
         } else {
/* 1463 */           c.getPlayer().dropMessage(6, "搜索的类型错误或不可用");
         }
       }
/* 1466 */       return 0;
     }
   }



   public static class ID
     extends Find {}


   public static class LookUp
     extends Find {}


   public static class Search
     extends Find {}


   public static class WhosFirst
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/* 1488 */       long currentTime = System.currentTimeMillis();
/* 1489 */       List<Pair<String, Long>> players = new ArrayList<>();
/* 1490 */       for (MapleCharacter chr : c.getPlayer().getMap().getCharactersThreadsafe()) {
/* 1491 */         if (!chr.isIntern()) {
/* 1492 */           players.add(new Pair(MapleCharacterUtil.makeMapleReadable(chr.getName()) + ((currentTime - chr.getCheatTracker().getLastAttack() > 600000L) ? " (AFK)" : ""), Long.valueOf(chr.getChangeTime())));
         }
       }
/* 1495 */       players.sort(new WhoComparator());
/* 1496 */       StringBuilder sb = new StringBuilder("List of people in this map in order, counting AFK (10 minutes):  ");
/* 1497 */       for (Pair<String, Long> z : players) {
/* 1498 */         sb.append((String)z.left).append(", ");
       }
/* 1500 */       c.getPlayer().dropMessage(6, sb.toString().substring(0, sb.length() - 2));
/* 1501 */       return 0;
     }



     public static class WhoComparator
       implements Comparator<Pair<String, Long>>, Serializable
     {
       private static final long serialVersionUID = -595003339775165157L;



       public int compare(Pair<String, Long> o1, Pair<String, Long> o2) {
/* 1514 */         if (((Long)o1.right).longValue() > ((Long)o2.right).longValue())
/* 1515 */           return 1; 
/* 1516 */         if (o1.right == o2.right) {
/* 1517 */           return 0;
         }
/* 1519 */         return -1;
       }
     }
   }



   public static class WhosLast
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/* 1530 */       if (splitted.length < 2) {
/* 1531 */         StringBuilder stringBuilder = new StringBuilder("用法: !whoslast [type] where type can be:  ");
/* 1532 */         for (MapleSquadType mapleSquadType : MapleSquadType.values()) {
/* 1533 */           stringBuilder.append(mapleSquadType.name()).append(", ");
         }
/* 1535 */         c.getPlayer().dropMessage(6, stringBuilder.toString().substring(0, stringBuilder.length() - 2));
/* 1536 */         return 0;
       }
/* 1538 */       MapleSquadType t = MapleSquadType.valueOf(splitted[1].toLowerCase());
/* 1539 */       if (t == null) {
/* 1540 */         StringBuilder stringBuilder = new StringBuilder("用法: !whoslast [type] where type can be:  ");
/* 1541 */         for (MapleSquadType z : MapleSquadType.values()) {
/* 1542 */           stringBuilder.append(z.name()).append(", ");
         }
/* 1544 */         c.getPlayer().dropMessage(6, stringBuilder.toString().substring(0, stringBuilder.length() - 2));
/* 1545 */         return 0;
       }
/* 1547 */       if (t.queuedPlayers.get(Integer.valueOf(c.getChannel())) == null) {
/* 1548 */         c.getPlayer().dropMessage(6, "The queue has not been initialized in this channel yet.");
/* 1549 */         return 0;
       }
/* 1551 */       c.getPlayer().dropMessage(6, "Queued players: " + ((ArrayList)t.queuedPlayers.get(Integer.valueOf(c.getChannel()))).size());
/* 1552 */       StringBuilder sb = new StringBuilder("List of participants:  ");
/* 1553 */       for (Pair<String, String> z : (Iterable<Pair<String, String>>)t.queuedPlayers.get(Integer.valueOf(c.getChannel()))) {
/* 1554 */         sb.append((String)z.left).append('(').append((String)z.right).append(')').append(", ");
       }
/* 1556 */       c.getPlayer().dropMessage(6, sb.toString().substring(0, sb.length() - 2));
/* 1557 */       return 0;
     }
   }


   public static class WhosNext
     extends CommandExecute
   {
     public int execute(MapleClient c, String[] splitted) {
/* 1566 */       if (splitted.length < 2) {
/* 1567 */         StringBuilder stringBuilder = new StringBuilder("用法: !whosnext [type] where type can be:  ");
/* 1568 */         for (MapleSquadType mapleSquadType : MapleSquadType.values()) {
/* 1569 */           stringBuilder.append(mapleSquadType.name()).append(", ");
         }
/* 1571 */         c.getPlayer().dropMessage(6, stringBuilder.toString().substring(0, stringBuilder.length() - 2));
/* 1572 */         return 0;
       }
/* 1574 */       MapleSquadType t = MapleSquadType.valueOf(splitted[1].toLowerCase());
/* 1575 */       if (t == null) {
/* 1576 */         StringBuilder stringBuilder = new StringBuilder("用法: !whosnext [type] where type can be:  ");
/* 1577 */         for (MapleSquadType z : MapleSquadType.values()) {
/* 1578 */           stringBuilder.append(z.name()).append(", ");
         }
/* 1580 */         c.getPlayer().dropMessage(6, stringBuilder.toString().substring(0, stringBuilder.length() - 2));
/* 1581 */         return 0;
       }
/* 1583 */       if (t.queue.get(Integer.valueOf(c.getChannel())) == null) {
/* 1584 */         c.getPlayer().dropMessage(6, "The queue has not been initialized in this channel yet.");
/* 1585 */         return 0;
       }
/* 1587 */       c.getPlayer().dropMessage(6, "Queued players: " + ((ArrayList)t.queue.get(Integer.valueOf(c.getChannel()))).size());
/* 1588 */       StringBuilder sb = new StringBuilder("List of participants:  ");
/* 1589 */       long now = System.currentTimeMillis();
/* 1590 */       for (Pair<String, Long> z : (Iterable<Pair<String, Long>>)t.queue.get(Integer.valueOf(c.getChannel()))) {
/* 1591 */         sb.append((String)z.left).append('(').append(StringUtil.getReadableMillis(((Long)z.right).longValue(), now)).append(" ago),");
       }
/* 1593 */       c.getPlayer().dropMessage(6, sb.toString().substring(0, sb.length() - 2));
/* 1594 */       return 0;
     }
   }


   public static class WarpMap
     extends CommandExecute
   {
     public String getParameter() {
/* 1603 */       return "<地图ID>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1608 */       if (splitted.length < 2) {
/* 1609 */         c.getPlayer().dropMessage(6, "用法: !WarpMap " + getParameter());
/* 1610 */         return 0;
       }
       try {
/* 1613 */         MapleMap target = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(splitted[1]));
/* 1614 */         if (target == null) {
/* 1615 */           c.getPlayer().dropMessage(6, "输入的地图不存在.");
/* 1616 */           return 0;
         }
/* 1618 */         MapleMap from = c.getPlayer().getMap();
/* 1619 */         for (MapleCharacter chr : from.getCharactersThreadsafe()) {
/* 1620 */           chr.changeMap(target, target.getPortal(0));
         }
/* 1622 */       } catch (Exception e) {
/* 1623 */         c.getPlayer().dropMessage(5, "错误: " + e.getMessage());
/* 1624 */         return 0;
       }
/* 1626 */       return 1;
     }
   }


   public static class KillAll
     extends CommandExecute
   {
     public String getParameter() {
/* 1635 */       return "留空或 <范围> [地图ID]";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1640 */       MapleMap map = c.getPlayer().getMap();
/* 1641 */       double range = Double.POSITIVE_INFINITY;
/* 1642 */       if (splitted.length > 1) {
/* 1643 */         int irange = Integer.parseInt(splitted[1]);
/* 1644 */         if (splitted.length <= 2) {
/* 1645 */           range = (irange * irange);
         } else {
/* 1647 */           map = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(splitted[2]));
         }
       }
/* 1650 */       if (map == null) {
/* 1651 */         c.getPlayer().dropMessage(6, "输入的地图不存在.");
/* 1652 */         return 0;
       }

/* 1655 */       for (MapleMapObject monstermo : map.getMapObjectsInRange(c.getPlayer().getPosition(), range, Collections.singletonList(MapleMapObjectType.MONSTER))) {
/* 1656 */         MapleMonster mob = (MapleMonster)monstermo;
/* 1657 */         if (!mob.getStats().isBoss() || mob.getStats().isPartyBonus() || c.getPlayer().isGM()) {
/* 1658 */           map.killMonster(mob, c.getPlayer(), false, false, (byte)1);
         }
       }
/* 1661 */       return 1;
     }
   }


   public static class seeban
     extends CommandExecute
   {
     public String getParameter() {
/* 1670 */       return "<角色名字>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1675 */       if (splitted.length < 2) {
/* 1676 */         c.getPlayer().dropMessage(6, "[用法] !seeban " + getParameter());
/* 1677 */         return 0;
       }
/* 1679 */       String msg = MapleClient.getAccInfoByName(splitted[1], c.getPlayer().isAdmin());
/* 1680 */       if (msg != null) {
/* 1681 */         c.getPlayer().dropMessage(6, msg);
       } else {
/* 1683 */         c.getPlayer().dropMessage(6, "输入的角色名字错误，无法找到信息.");
       }
/* 1685 */       return 1;
     }
   }


   public static class seeaccount
     extends CommandExecute
   {
     public String getParameter() {
/* 1694 */       return "<玩家账号>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1699 */       if (splitted.length < 2) {
/* 1700 */         c.getPlayer().dropMessage(6, "[用法] !seeaccount " + getParameter());
/* 1701 */         return 0;
       }
/* 1703 */       String msg = MapleClient.getAccInfo(splitted[1], c.getPlayer().isAdmin());
/* 1704 */       if (msg != null) {
/* 1705 */         c.getPlayer().dropMessage(6, msg);
       } else {
/* 1707 */         c.getPlayer().dropMessage(6, "输入的账号错误，无法找到信息.");
       }
/* 1709 */       return 1;
     }
   }


   public static class liedetector
     extends CommandExecute
   {
     public String getParameter() {
/* 1718 */       return "<角色名字>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1723 */       if (splitted.length < 2) {
/* 1724 */         c.getPlayer().dropMessage(6, "!liedetector " + getParameter());
/* 1725 */         return 0;
       }
/* 1727 */       MapleCharacter chr = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
/* 1728 */       if (chr != null && c.getPlayer().getGMLevel() >= chr.getGMLevel()) {
/* 1729 */         if (chr.getMapId() == 180000001) {
/* 1730 */           c.getPlayer().dropMessage(6, "玩家 " + chr.getName() + " 在监狱地图无法对其使用.");
/* 1731 */         } else if (!chr.getAntiMacro().startLieDetector(chr.getName(), false, false)) {
/* 1732 */           c.getPlayer().dropMessage(6, "对玩家 " + chr.getName() + " 使用测谎仪失败.");
         } else {
/* 1734 */           c.getPlayer().dropMessage(6, "已成功对玩家 " + chr.getName() + " 使用测谎仪.");
         }
       } else {
/* 1737 */         c.getPlayer().dropMessage(6, "请确保要测谎的玩家处于在线状态.");
/* 1738 */         return 0;
       }
/* 1740 */       return 1;
     }
   }




   public static class HellB
     extends HellBan {}




   public static class HellBan
     extends Ban {}




   public static class UnHellB
     extends UnHellBan {}




   public static class UnHellBan
     extends UnBan {}




   public static class UnB
     extends UnBan {}




   public static class UnBan
     extends CommandExecute
   {
     protected boolean hellban = false;



     private String getCommand() {
/* 1785 */       if (this.hellban) {
/* 1786 */         return "UnHellBan";
       }
/* 1788 */       return "UnBan";
     }



     public String getParameter() {
/* 1794 */       return "<角色名>";
     }

     public int execute(MapleClient c, String[] splitted) {
       byte ret;
/* 1799 */       if (splitted.length < 2) {
/* 1800 */         c.getPlayer().dropMessage(6, "用法: !" + getCommand() + " " + getParameter());
/* 1801 */         return 0;
       }

/* 1804 */       if (this.hellban) {
/* 1805 */         ret = MapleClient.unHellban(splitted[1]);
       } else {
/* 1807 */         ret = MapleClient.unban(splitted[1]);
       }
/* 1809 */       if (ret == -2) {
/* 1810 */         c.getPlayer().dropMessage(6, "[" + getCommand() + "] 数据库查询出错.");
/* 1811 */         return 0;
/* 1812 */       }  if (ret == -1) {
/* 1813 */         c.getPlayer().dropMessage(6, "[" + getCommand() + "] 角色 " + splitted[1] + " 不存在.");
/* 1814 */         return 0;
       }
/* 1816 */       c.getPlayer().dropMessage(6, "[" + getCommand() + "] 已经成功将玩家 " + splitted[1] + " 解除封停!");
/* 1817 */       InternCommand.log.info("[命令] 管理员 " + c.getPlayer().getName() + " 将玩家 " + splitted[1] + " 解除封号.");

/* 1819 */       byte ret_ = MapleClient.unbanIPMacs(splitted[1]);
/* 1820 */       if (ret_ == -2) {
/* 1821 */         c.getPlayer().dropMessage(6, "[UnbanIP] 数据库查询出错.");
/* 1822 */       } else if (ret_ == -1) {
/* 1823 */         c.getPlayer().dropMessage(6, "[UnbanIP] 输入的角色不存在.");
/* 1824 */       } else if (ret_ == 0) {
/* 1825 */         c.getPlayer().dropMessage(6, "[UnbanIP] No IP or Mac with that character exists!");
/* 1826 */       } else if (ret_ == 1) {
/* 1827 */         c.getPlayer().dropMessage(6, "[UnbanIP] IP/Mac -- one of them was found and unbanned.");
/* 1828 */       } else if (ret_ == 2) {
/* 1829 */         c.getPlayer().dropMessage(6, "[UnbanIP] Both IP and Macs were unbanned.");
       }
/* 1831 */       return (ret_ > 0) ? 1 : 0;
     }
   }


   public static class UnbanIP
     extends CommandExecute
   {
     public String getParameter() {
/* 1840 */       return "<角色名>";
     }


     public int execute(MapleClient c, String[] splitted) {
/* 1845 */       if (splitted.length < 2) {
/* 1846 */         c.getPlayer().dropMessage(6, "用法: !UnbanIP " + getParameter());
/* 1847 */         return 0;
       }
/* 1849 */       byte ret = MapleClient.unbanIPMacs(splitted[1]);
/* 1850 */       if (ret == -2) {
/* 1851 */         c.getPlayer().dropMessage(6, "[UnbanIP] 数据库查询出错.");
/* 1852 */       } else if (ret == -1) {
/* 1853 */         c.getPlayer().dropMessage(6, "[UnbanIP] 输入的角色不存在.");
/* 1854 */       } else if (ret == 0) {
/* 1855 */         c.getPlayer().dropMessage(6, "[UnbanIP] No IP or Mac with that character exists!");
/* 1856 */       } else if (ret == 1) {
/* 1857 */         c.getPlayer().dropMessage(6, "[UnbanIP] IP/Mac -- one of them was found and unbanned.");
/* 1858 */       } else if (ret == 2) {
/* 1859 */         c.getPlayer().dropMessage(6, "[UnbanIP] Both IP and Macs were unbanned.");
       }
/* 1861 */       if (ret > 0) {
/* 1862 */         return 1;
       }
/* 1864 */       return 0;
     }
   }
 }


/* Location:              C:\PGX\Server.jar!\server\commands\InternCommand.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */